<?php
declare (strict_types = 1);

namespace app\validate;

use think\Validate;

class CompanyStore extends BaseValidate
{
    /**
     * 定义验证规则
     * 格式：'字段名' =>  ['规则1','规则2'...]
     *
     * @var array
     */
    protected $rule = [
        'name'=>'require|length:2,50',
        'desc'=>'max:100',
        'employee_num'=>'require|number|between:1,9999999',
        'charge_person'=>'require|max:30',
        'charge_person_phone'=>'require|mobile'
    ];

    /**
     * 定义错误信息
     * 格式：'字段名.规则名' =>  '错误信息'
     *
     * @var array
     */
    protected $message = [
        'name.require'=>'请输入公司名称',
        'name.length'=>'公司名称长度为2-50位',
        'desc.max'=>'公司描述不能超过100个字',
        'employee_num.require'=>'请输入员工数量',
        'employee_num.number'=>'员工数量格式不正确',
        'employee_num.between'=>'员工数量只能在1-9999999之间',
        'charge_person.require'=>'请输入负责人姓名',
        'charge_person.max'=>'负责人姓名不能超过30个字',
        'charge_person_phone.require'=>'请输入手机号',
        'charge_person_phone.mobile'=>'请输入正确的手机号'
    ];
}
